// Do not remove the include below
#include "GrillProj.h"

#define PINTACH 	15
#define PINCTRL 	 9

//The setup function is called once at startup of the sketch
void setup()
{
	Serial.begin(115200);

	Fan1.initialize(PINTACH, PINCTRL);

}

// The loop function is called in an endless loop
void loop()
{

	int rpmSet;

	Serial.println("Algorithm Characterization");

	Serial.print("Fan minimum speed: ");
	Serial.println(Fan1.huntMinSpeed(10));

	Serial.print("Fan maximum speed: ");
	Serial.println(Fan1.huntMaxSpeed(10));

	for (rpmSet = 450; rpmSet <= 2000; rpmSet = rpmSet + 5) {

		Serial.print("SetPoint:\t");
		Serial.print(rpmSet);
		Serial.print('\t');

		Fan1.setRPMValue(rpmSet, 0, 0);

		delay(2000);
		Serial.println(Fan1.getRPM());

	}

}
